Skip to content

fix(chat): Raise Chat above the overlay so the composer draws a caret - #898

Closed
omesser wants to merge 1 commit into
mainfrom
fix/891-chat-caret
Closed

omesser wants to merge 1 commit into
mainfrom
fix/891-chat-caret

Conversation

@omesser

@omesser omesser commented Sep 22, 2026 •

Copy link
Copy Markdown
Owner

Draft: this does not prove a fix. The baseline run below says the change in
this branch is not what makes the caret appear. Kept open for the finding, not
to merge. See #900, which takes the page-level route.

Why

The Chat composer drew no text caret, so typing and editing were blind.

The overlay covers every display from a window band above the normal one, and a
Chat window opened into the normal band — so it sat behind the sprite layer for
its whole life. Settings hit that and was raised out of it in #803; Chat never
was. That reading of the source is still true. It is not what causes the
missing caret.

What changed

raise_settings_window keeps its body and loses its Settings-only name:
raise_above_overlay. open_chat calls it after set_focus, as show_settings
does. AI_BUDDY_OPEN_CHAT joins the AI_BUDDY_OPEN_SETTINGS hook beside it, so
a sitting can reach the composer without a synthetic tray click.

How to verify

scripts/verify-chat-caret-macos.sh, twice: once on this branch, once on a build
with only the raise_above_overlay call removed. Same script, same rects, same
burst timing, same scratch HOME.

Arm composer prompt (control)
raise present differing=12/15 columns=4 rows=31 span=28..31 caret=true caret=true
raise removed differing=12/15 columns=4 rows=31 span=28..31 caret=true caret=true

Identical. The caret is there without the raise, so the raise is not what lights
it. The two binaries did differ — the baseline carries no chat: … raise: format
string and this one does.

cargo test -p ai-buddy --all-targets 521 passed, cargo clippy --all-targets -- -D warnings clean, node --test tests/*.test.js 291 passed.

Notes

  • The harness manufactures the state it measures. It activates ai-buddy
    before capturing, and an activated window paints a caret whatever else is
    wrong. So it would pass on the broken build too. It is not yet a regression
    guard, and the two rows above are the evidence for that, not against it.
  • There was no clean baseline until this run. An earlier burst that came back
    byte-identical had the Settings window overlapping the composer rect, so it was
    a still picture of Settings, not of a caretless composer. It proved nothing and
    should not be cited.
  • AX cannot see a caret. A focused field reports AXSelectedTextRange whether
    or not one is painted, which is why this was filed against a window every AX
    assertion called healthy. Note key=false in the script's output: that pair
    reads the same in the healthy state, so it diagnoses nothing. An earlier
    revision of this description leaned on it; that was wrong.
  • What is still unanswered: what a user hits through a tray Summon, with no
    activation from a script. That wants a burst taken without activating, which is
    less intrusive than what ran here.

Refs #891

— Claude Code agent, on @omesser's behalf.

🤖 Generated with Claude Code

The overlay covers every display from a band above the normal one, so a
Chat window was behind the sprite layer for its whole life. Settings has
taken this raise since #803; Chat now takes the same one.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@omesser

omesser commented Sep 22, 2026

Copy link
Copy Markdown
Owner Author

Closing. The change in here does not fix #891, and the branch stays if any of it is wanted back.

Two arms were captured with identical binaries differing only in the raise_above_overlay call from open_chat. The composer drew a caret in both, identical to the pixel. So Chat does open beneath a full-display floating panel, as the source reading said, but that is not what keeps the caret off the screen.

Leaving this open would park a pull request whose title claims a fix it does not make, next to #900, which is the live candidate.

What is in here, for whoever wants it later:

  • raise_settings_window renamed to raise_above_overlay. A neutral improvement that stands on its own, since the function was never Settings-specific. Not worth a pull request by itself today.
  • AI_BUDDY_OPEN_CHAT, a dev flag that opens Chat at startup. Genuinely useful for caret work, because it removes the tray click from any repro.
  • scripts/verify-chat-caret-macos.sh and scripts/ax-chat-caret.swift. Do not land these as written. The Swift driver calls activate() before capturing, which manufactures the healthy state it then measures, so it would pass against a broken build. It is not a regression guard, and that confound is why the first run looked like a proof.

#891 carries the corrections, including the two hypotheses this work ruled out and the one bullet in the issue body that wrongly discouraged the caret-color route #900 takes.

— Claude Code agent, on @omesser's behalf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant